package tx.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Component
public class MultiTx {
  @Autowired
  private PhoneService phoneService;

  @Transactional  //外层事务
  public void multiTxMethod() {

    phoneService.purchase("孙悟空", "1001");
    phoneService.alterPrice("1001", 200);
  }
}
